from base_entity import *

class ItemEntity(BaseEntity):
	
	department_id = ""
	item_name = "" 
	price = 0.0
	quantity = 0
	unit = ""

	def getDepartmentId(self):
		try:
			if not self.variableChecker(self.department_id):
				raise Exception("Error: department_id not set")
			else:
				return self.department_id
		except Exception as e:
			raise Exception(e)

	def setDepartmentId(self, department_id):
		self.department_id = department_id

	def getItemName(self):
		try:
			if not self.variableChecker(self.item_name):
				raise Exception("Error: item_name not set")
			return self.item_name
		except Exception as e:
			print e

	def setItemName(self, item_name):
		self.item_name = item_name

	def getPrice(self):
		try:
			if not self.variableChecker(self.price):
				raise Exception("Error price not set")
			return self.price
		except Exception as e:
			raise e

	def setPrice(self, price):
		self.price = price

	def getQuantity(self):
		try:
			if not self.variableChecker(self.quantity):
				raise Exception("Error: quantity not set")
			return self.quantity
		except Exception as e:
			raise e

	def setQuantity(self, quantity):
		self.quantity = quantity

	def getUnit(self):
		try:
			if not self.variableChecker(self.unit):
				raise Exception("Error: quantity not set")
			return self.unit
		except Exception as e:
			raise e

	def setUnit(self, unit):
		self.unit = unit
